package com.whu.waterworks.dao;
// default package

import java.util.List;

import com.whu.waterworks.model.Realtimedata;
import com.whu.waterworks.model.RealtimedataId;

/**
 * Interface for TRealtimedataDAO.
 * 
 * @author MyEclipse Persistence Tools
 */

public interface RealtimedataDAO {
	
	
	public boolean save(Realtimedata entity);

	/**
	 * Delete a persistent TRealtimedata entity. This operation must be
	 * performed within the a database transaction context for the entity's data
	 * to be permanently deleted from the persistence store, i.e., database.
	 * This method uses the
	 * {@link javax.persistence.EntityManager#remove(Object)
	 * EntityManager#delete} operation.
	 * 
	 * <pre>
	 * EntityManagerHelper.beginTransaction();
	 * ITRealtimedataDAO.delete(entity);
	 * EntityManagerHelper.commit();
	 * entity = null;
	 * </pre>
	 * 
	 * @param entity
	 *            TRealtimedata entity to delete
	 * @throws RuntimeException
	 *             when the operation fails
	 */
	public boolean delete(Realtimedata entity);


	
	/**
	 * 更新数据
	 * @author wangying
	 * @param entity
	 * @return
	 */
	public boolean  update(Realtimedata entity);

	public Realtimedata findById(RealtimedataId id);

	/**
	 * Find all TRealtimedata entities with a specific property value.
	 * 
	 * @param propertyName
	 *            the name of the TRealtimedata property to query
	 * @param value
	 *            the property value to match
	 * @return List<TRealtimedata> found by query
	 */
	public List<Realtimedata> findByProperty(String propertyName, Object value);

	public List<Realtimedata> findByValue(Object value);

	/**
	 * Find all TRealtimedata entities.
	 * 
	 * @return List<TRealtimedata> all TRealtimedata entities
	 */
	public List<Realtimedata> findAll();
	
	/**
	 * 获取指定id的全部类型的实时数据
	 * @author wangying
	 * @param id
	 * @return
	 */
	public List<Realtimedata> findAllById(String id);
	
	/**
	 * 得到指定id的指定类型数据
	 * @author wangying
	 * @param id
	 * @param type
	 * @return
	 */
	public List<Realtimedata> findByIdTodayAll(String id,String type);
	
	/**
	 * 获取指定id在指定时间内的指定类型数据
	 * @author wangying
	 * @param id
	 * @param type
	 * @param endTime
	 * @param beginTime
	 * @return
	 */
	public List<Realtimedata> findByIdAllInTime(String id, String type, String endTime, String beginTime);
}